<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<!DOCTYPE html>
<html>
<head>
<title></title>

<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- 引入bootstrap -->
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath}/css/bootstrap.min.css">
<!-- 引入JQuery  bootstrap.js-->
<script src="${pageContext.request.contextPath}/js/jquery-3.2.1.min.js"></script>
<script src="${pageContext.request.contextPath}/js/bootstrap.min.js"></script>
<script src="${pageContext.request.contextPath}/js/operationport.js"></script>
</head>
<body>
	<!-- 顶栏 -->
	<jsp:include page="../admin/top.jsp"></jsp:include>
	<!-- 中间主体 -->
	<div class="container" id="content">
		<div class="row">
			<%@ include file="/WEB-INF/jsp/admin/menu.jsp"%>
			<div class="col-md-10">
				<div class="panel panel-default">
					<div class="panel-heading">
						<div class="row">
							<h1 style="text-align: center;">添加用例</h1>
						</div>
					</div>
					<div class="panel-body">
						<form class="form-horizontal" role="form"
							action="${pageContext.request.contextPath}/port/addPort"
							id="editfrom" method="post">
							<%-- <div class="form-group">
								<label for="inputPassword3" class="col-sm-2 control-label"
									name="itemId">所属环境：</label>
								<div class="col-sm-10">
									<select class="form-control" name="envId" id="envId" style="width: 55%">
										<option value="0">请选择</option>
										<c:forEach var="envList" items="${envList}">
											<option value="${envList.id}">${envList.name}</option>
										</c:forEach>
									</select>
								</div>
							</div> --%>

							<div class="form-group">
								<label for="inputPassword3" class="col-sm-2 control-label"
									name="itemId">所属项目：</label>
								<div class="col-sm-10">
									<select class="form-control"  name="envId" id="envId" style="width: 55%">
										<option value="0">请选择</option>
										<c:forEach var="caseItemList" items="${caseItemList}">
											<option value="${caseItemList.id}">${caseItemList.name}</option>
										</c:forEach>
									</select>
								</div>
							</div>

							<div class="form-group">
								<td><label for="inputEmail3" class="col-sm-2 control-label">接口名称：</label></td>
								<td><input id="portName" name="portName" type="text"
									value="" style="width: 430px;" class="form-control"
									placeholder="请输入接口名称" /></td>
							</div>
							<div class="form-group">
								<td><label for="inputPassword3"
									class="col-sm-2 control-label">接口url：</label></td>
								<td><input id="porturl" name="porturl" type="text" value=""
									style="width: 430px;" class="form-control"
									placeholder="请输入接口url" /></td>
							</div>
							<div class="form-group">
								<td><label for="inputPassword3"
									class="col-sm-2 control-label">请求方式：</label></td>
								<td><label class="checkbox-inline"> <input
										type="radio" name="type" value="0" checked>GET
								</label> <label class="checkbox-inline"> <input type="radio"
										name="type" value="1">POST </td> </label>
							</div>

							<div class="form-group">
								<label class="col-sm-2 control-label">请求参数：</label>
								<div class="col-sm-8">
									<button id="add_request_body" class="btn btn-primary"
										type="button">
										<i class="fa fa-plus-square-o"></i>&nbsp;添加行
									</button>
								</div>
								<div class="col-sm-offset-2 col-sm-8">
									<table id="request_body" class="table col-sm-10">
										<thead>
											<tr>
												<th>参数名</th>
												<th>参数值</th>
												<th></th>
											</tr>
										</thead>
										<tbody>
										</tbody>
									</table>
								</div>
							</div>

							<div class="form-group">
								<td><label for="inputPassword3"
									class="col-sm-2 control-label">描述：</label></td>
								<td><textarea rows="3" cols="40" id="remark" name="remark"></textarea>
								</td>
							</div>

							<div class="form-group">
								<td><label for="inputPassword3"
									class="col-sm-2 control-label">启用状态：</label></td>
								<td><label class="checkbox-inline"> <input
										type="radio" name="status" value="1" checked>启用
								</label> <label class="checkbox-inline"> <input type="radio"
										name="status" value="0">不启用</td> </label>
							</div>
							</br> </br>

							<div class="form-group" style="text-align: center">
								<input type="button" class="btn btn-primary" value="提交"
									onclick="addport()">
								<button class="btn btn-default" type="reset">重置</button>
							</div>
						</form>
					</div>

				</div>

			</div>
		</div>
	</div>
	<div class="container" id="footer">
		<div class="row">
			<div class="col-md-12"></div>
		</div>
	</div>
</body>
<script type="text/javascript">
	$("#nav li:nth-child(3)").addClass("active")
</script>
</html>